package com.njtoyo.taxi.admin.service.local_service.commodity;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.mapper.master.entity.local_service.LifeMerchantCommodity;
import com.njtoyo.taxi.admin.rest.presenter.local_service.commodity.CommodityDetailsPresenter;
import com.njtoyo.taxi.admin.rest.presenter.local_service.commodity.CommodityPagePresenter;
import com.njtoyo.taxi.admin.rest.wrapper.local_service.commodity.CommodityAddWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.local_service.commodity.CommodityBatchUpdateWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.local_service.commodity.CommodityPageWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.local_service.commodity.CommodityUpdateWrapper;
import com.taxi.entity.common.RestResult;
import com.njtoyo.taxi.entity.backend.AdminUser;

import java.text.ParseException;
import java.util.List;

public interface CommodityService {

    /**
     * 所有商品
     *
     * @return
     */
    RestResult<List<LifeMerchantCommodity>> all();

    /**
     * 商户下所有商品
     *
     * @return
     */
    RestResult<List<LifeMerchantCommodity>> allByMerchantId(Long  merchantId );

    /**
     * 商品列表
     *
     * @param adminUser
     * @param wrapper
     * @return
     */
    RestResult<Page<CommodityPagePresenter>> getPage(AdminUser adminUser, CommodityPageWrapper wrapper);

    /**
     * 商品详情
     *
     * @param id
     * @return
     */
    RestResult<CommodityDetailsPresenter> details(Long id);

    /**
     * 添加商品
     *
     * @param wrapper
     * @return
     */
    RestResult<CommodityDetailsPresenter> add(CommodityAddWrapper wrapper) throws ParseException;

    /**
     * 修改商品
     *
     * @param wrapper
     * @return
     */
    RestResult<CommodityDetailsPresenter> update(Long id, CommodityUpdateWrapper wrapper) throws ParseException;

    /**
     * 删除商品
     *
     * @param id
     * @return
     */
    RestResult delete(Long id);

    /**
     * 批量操作商品
     *
     * @param wrapper
     * @return
     */
    RestResult updateBatch(CommodityBatchUpdateWrapper wrapper);
}
